import java.util.Scanner;//1600: 【入门】请假时间计算

public class Main1600 {
    public static void main(String[] args) {
        Scanner sc =new Scanner(System.in);
        int n =sc.nextInt();
        System.out.print(n*24);
        System.out.println(n*24*60);

    }
}
